  import { message } from "antd";
  import axios from "axios";

  const req = axios.create({
      baseURL: "https://www.codeman.ink/api",
      timeout: 10000
  })
  req.interceptors.request.use(config => {
      return config;
  }, err => {
      return Promise.reject(err)
  });
  req.interceptors.response.use(config => {
      const data = config.data;
      if (data.code !== 200) {
          message.error(data.msg || '异常')
          return {}
      }

      return data
  }, err => {
      return Promise.reject(err)
  })

  export default req;